///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __MATRIX_H__
#define __MATRIX_H__
//-----------------------------------------------------------------------------

#include <Config.h>
class	Vec3f;

//-----------------------------------------------------------------------------

class	Matrix4x4
{
public:
						Matrix4x4();
	virtual				~Matrix4x4();

	void				SetIdentity();
	bool				IsIdentity();

	Vec3f				GetPosition();
	void				GetPosition(Vec3f& pos);
	void				SetPosition(f32 x, f32 y, f32 z, f32 w = 1.0f);
	void				SetPosition(Vec3f& pos);

	void				Translate(f32 x, f32 y, f32 z);
	void				Rotate(f32 angle, f32 x, f32 y, f32 z);
	void				Scale(f32 sx, f32 sy, f32 sz);
	void				Transpose();
	Matrix4x4			GetTranspose();
	void				Inverse();
	Matrix4x4			GetInverse();

	void				SetFrustum(f32 left, f32 right, f32 bottom, f32 top, f32 nearZ, f32 farZ);
	void				SetPerspective(f32 fovy, f32 aspect, f32 nearZ, f32 farZ);
	void				SetOrtho(f32 left, f32 right, f32 bottom, f32 top, f32 nearZ, f32 farZ);

	Matrix4x4			GetGLMatrix();

	Matrix4x4& operator = (const Matrix4x4& mat);
	Matrix4x4& operator += (const Matrix4x4& mat);
	Matrix4x4& operator -= (const Matrix4x4& mat);
	Matrix4x4& operator *= (const Matrix4x4& mat);

	Matrix4x4& operator = (const f32& val);
	Matrix4x4& operator += (const f32& val);
	Matrix4x4& operator -= (const f32& val);
	Matrix4x4& operator *= (const f32& val);
	Matrix4x4& operator /= (const f32& val);

	const Matrix4x4 operator + (const Matrix4x4& mat) const;
	const Matrix4x4 operator - (const Matrix4x4& mat) const;
	const Matrix4x4 operator * (const Matrix4x4& mat) const;

	const Matrix4x4 operator + (const f32& val) const;
	const Matrix4x4 operator - (const f32& val) const;
	const Matrix4x4 operator * (const f32& val) const;
	const Matrix4x4 operator / (const f32& val) const;

//private:
    f32				   m[4][4];
};

#endif	//	__MATRIX_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
